package org.mcclone.splitter;

import java.util.Collection;
import java.util.Iterator;

/**
 * @author McClone
 */
public abstract class CollectionUtils {

    public static <T> void addToCollection(Collection<T> collection, Iterator<T> iterator, int size) {
        while (iterator.hasNext()) {
            collection.add(iterator.next());
            if (size == collection.size())
                return;
        }
    }
}
